package ex02.pyrmont;

import com.sky.JULLog.MyLogger;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Logger;
/**
 * 请求门面
 *
 * 通用的 父类给你处理好,  想自己实现的自己重写;
 * */
public class RequestFacade implements ServletRequest {



  private  static Logger log = MyLogger.getLogger(RequestFacade.class);

  private ServletRequest request ;

  public RequestFacade(RequestV1 request) {

    this.request = request;
    log.info("请求被 门面包装....");

  }

  /* implementation of the ServletRequest*/
  @Override
  public Object getAttribute(String attribute) {
    return request.getAttribute(attribute);
  }

  @Override
  public Enumeration getAttributeNames() {
    return request.getAttributeNames();
  }

  @Override
  public String getRealPath(String path) {
    return request.getRealPath(path);
  }

  @Override
  public RequestDispatcher getRequestDispatcher(String path) {
    return request.getRequestDispatcher(path);
  }

  @Override
  public boolean isSecure() {
    return request.isSecure();
  }

  @Override
  public String getCharacterEncoding() {
    return request.getCharacterEncoding();
  }

  @Override
  public int getContentLength() {
    return request.getContentLength();
  }

  @Override
  public String getContentType() {
    return request.getContentType();
  }

  @Override
  public ServletInputStream getInputStream() throws IOException {
    return request.getInputStream();
  }

  @Override
  public void setCharacterEncoding(String s) throws UnsupportedEncodingException {

  }

  @Override
  public String getParameter(String s) {
    return null;
  }

  @Override
  public Enumeration getParameterNames() {
    return null;
  }

  @Override
  public String[] getParameterValues(String s) {
    return new String[0];
  }

  @Override
  public Map getParameterMap() {
    return null;
  }

  @Override
  public String getProtocol() {
    return null;
  }

  @Override
  public String getScheme() {
    return null;
  }

  @Override
  public String getServerName() {
    return null;
  }

  @Override
  public int getServerPort() {
    return 0;
  }

  @Override
  public BufferedReader getReader() throws IOException {
    return null;
  }

  @Override
  public String getRemoteAddr() {
    return null;
  }

  @Override
  public String getRemoteHost() {
    return null;
  }

  @Override
  public void setAttribute(String s, Object o) {

  }

  @Override
  public void removeAttribute(String s) {

  }

  @Override
  public Locale getLocale() {
    return null;
  }

  @Override
  public Enumeration getLocales() {
    return null;
  }
}